<!DOCTYPE html>

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title></title>
    <script src="./js/vue.js"></script>
</head>

<body>
    <div id="app">
        <input type="text" v-model="info">
        <button @click="zxc">发表评论</button>
        <div v-for="info in msg">
            {{info}}
        </div>
    </div>
    <script>
        var vm = new Vue({  
            el: '#app',
            data: {
                info:'',
                msg:[]
            },
            methods: {
                zxc(){
                    this.msg.push(this.info);
                    this.info = ""

                }
            }
        })
    </script>
</body>
</html>